use crate::bootstrap::AppState;
use crate::controller::admin::employee;
use axum::{
    routing::{delete, get, post, put},
    Router,
};
use utoipa::OpenApi;

#[derive(OpenApi)]
#[openapi(paths(employee::login, employee::add_employee, employee::page_query))]
pub(super) struct EmployeeApi;

pub fn employee_router(state: AppState) -> Router<AppState> {
    let router = Router::new()
        .route("/", post(employee::add_employee))
        .route("/", put(employee::update_employee))
        .route("/login", post(employee::login))
        .route("/page", get(employee::page_query))
        .route("/:user_id", get(employee::find_by_id))
        .route("/status/:status", post(employee::enable_disable))

        .with_state(state);

    router
}
